#include <iostream>
using namespace std;


int main()
{
    string s;
    cin >> s;
    bool hash[10] = { 0 };
    for (int i = s.size() - 1; i >= 0; i--)
    {
        int x = s[i] - '0';
        if (!hash[x])
        {
            hash[x] = true;
            cout << x;
        }
    }

    return 0;
}